<%@ page import="com.apexedu.portal.constant.Constants" %>
<%@ page import="java.util.List" %>
<%@ page import="com.apexedu.util.StringUtil" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme() + "://"
            + request.getServerName() + ":" + request.getServerPort()
            + path + "/";
    request.setAttribute("basePath", basePath);
    int h=500;
    String height = (String)request.getAttribute("height");
    if (StringUtil.isNotBlank(height)){
        h=Integer.parseInt(height)-40;
    }

    String location = (String)request.getAttribute("location");
    String title = (String)request.getAttribute("title");
    String categories = (String)request.getAttribute("categories");
    String yAxis = (String)request.getAttribute("yAxis");
    String series = (String)request.getAttribute("series");
    String pointStart = (String)request.getAttribute("pointStart");

    String[] lable = (String[])request.getAttribute("lmbh");
    String[] lablemc = (String[])request.getAttribute("lm");

    List resultData = (List)request.getAttribute("resultData");
%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
    <title><%=Constants.ProjectInfo.PROJECT_NAME%>
    </title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <link href="${basePath}/resources/css/mh.shd.css" rel="stylesheet">
    <script type="text/javascript" src="${basePath}/resources/ui/js/jquery-1.10.2.min.js"></script>
    <script src="${basePath}/resources/js/mh.shd.index.js" type="text/javascript"></script>
    <script src="${basePath}/component/highcharts-4.1.7/highcharts.js"></script>
    <script src="${basePath}/component/highcharts-4.1.7/modules/exporting.js"></script>
</head>
<body>
<script>
    var wz='<%=location%>';
    $(function(){
        brandPicTurn();
    })
    function brandPicTurn(){
        $(".brand_detail").hide();
        $(".brand_item").hover(
                function(){
                    $(this).children(".brand_name").hide();
                    $(this).children(".brand_detail").show();
                }
                , function(){
                    $(this).children(".brand_detail").hide();
                    $(this).children(".brand_name").show();
                }
        );
    }
    function add(){
        window.parent.addWin(wz);
    }
    function del(){
        window.parent.delWin(wz);
    }
</script>
<% if (location!=null&&location.length()>0) {%>

<div class="brand_item">
    <a href="javascript:;" onclick="add();" class="brand_name">
        <img src="${basePath}/resources/images/report/icon_setting.png"         width="28" height="28" border="0" style="position: absolute;right:50px;top:5px;" title="添加报表"/>
    </a>
    <a href="javascript:;" onclick="add();" class="brand_detail">
        <img src="${basePath}/resources/images/report/icon_setting-active.png" width="28" height="28" border="0"  style="position: absolute;right:50px;top:5px;" title="添加报表"/>
    </a>
</div>
<div class="brand_item">
    <a href="javascript:;" onclick="del();" class="brand_name">
        <img src="${basePath}/resources/images/report/icon_delet.png"         width="28" height="28" border="0" style="position: absolute;right:5px;top:5px;" title="清除报表"/>
    </a>
    <a href="javascript:;" onclick="del();" class="brand_detail">
        <img src="${basePath}/resources/images/report/icon_delet-active.png" width="28" height="28" border="0"  style="position: absolute;right:5px;top:5px;" title="清除报表"/>
    </a>
</div>
<%}%>
<div style="height: 20px;text-align: left;font-size: 16px;padding-left: 5px;"><%=title%></div>
<div class="contain" style="height:<%if(h!=0){%><%=h%>px<%}else {%>100%<%}%>;line-height:35px; margin-top:20px;overflow:scroll;background-color: #ffffff">
    <table style="border:1px solid #cccccc; text-align:center " width="100%" border="0" cellspacing="0" cellpadding="0">
        <tr style="background-color:#dffcdd">
            <%
             if (lablemc!=null&&lablemc.length>0){
                    for (int i=0;i<lablemc.length;i++){
                        if (i==0){
                        %>
                        <th style="border-bottom:1px solid #CCCCCC;border-right:1px solid #CCCCCC; font-size:14px;line-height:20px;height: 20px;white-space: nowrap;" scope="col" width="50" >
                            <span onclick=""><%=lablemc[i]%></span>
                        </th>
                        <%
                        }else{
                        %>
                            <th style="border-bottom:1px solid #CCCCCC;border-right:1px solid #CCCCCC; font-size:14px;white-space: nowrap;" scope="col" width="<%=100/(lablemc.length-1) %>%">
                                <span onclick=""><%=lablemc[i]%></span>
                            </th>
                          <%
                        }
                    }
             }
            %>
        </tr>
        <%
            if (resultData!=null&&resultData.size()>0){
                for (int j=0;j<resultData.size();j++){
        %>
        <tr>
            <%
                Object[] rd=(Object[])resultData.get(j);
                for (int k=0;k<rd.length;k++){
                   %>
                <td nowrap="nowrap" style="border-bottom:1px solid #CCCCCC;border-right:1px solid #CCCCCC; font-size:14px"><%=rd[k]!=null?rd[k]:""%></td>
                <%
                 }
            %>
        </tr>
        <%
                }
            }
        %>
    </table>
</div>
</body>
</html>